#pragma once
#include "Tile.h"
#include "CAmeFormat.h"
#include "os/Graphics/Texture.h"
#include "os/Animation/AnimationInfo.h"
#include "os/Collision/CheckCollision.h"

#include <vector>
using namespace std;

#ifndef TILEMAP_H
#define TILEMAP_H

namespace leo
{

class LEO_API TileMap
{

	std::vector<Tile* > tiles;
	std::vector<Tile* > tileMatrix;
	unsigned int **matriz;
	int width;
	int height;
	float x;
	float y;

	
	Texture::Ptr textura;
	Tile* tmpTile;
	ameHeader anacondaMap;
	AnimationInfo* anim;

public:
	TileMap(char* _file);
	~TileMap(void);
	
	void SetPos(int _x, int _y);
	void SetTile(int _tile, int _x, int _y);
    void SetCollisions(leo::CheckCollision* _col,int _n);

	void Create(int _tileHorizontal, int _tileVertical);
	void AddTile(Tile* _til);
	void ConvertFromAnaconda(leo::Graphics *_graph);
	
	void Draw(leo::Graphics *_graph);
	void Update(float _timeBetweenFrames);

#include "TileMap.inl"

};

}

#endif